Version of example with before string without curly quotes. Works fine. ----------------------------------------------------------------------- // When a string contains smart quotes (single or double), then encodeString // does not work. The string is not written into the buffer and only 0 bytes // are in the buffer. var buffer = Ti.createBuffer({ length: 46800 }); var before = 'This has no quotes'; var after; var bytes = new Array(before.length); Ti.API.info('before = ' + before); Ti.Codec.encodeString({ charset: Ti.Codec.CHARSET_ISO_LATIN_1, source: before, dest: buffer, destPosition: 15600 }); for (var b = 0; b < before.length; b ++) bytes[b] = Ti.Codec.decodeNumber({ source: buffer, position: 15600 + b, type: Ti.Codec.TYPE_BYTE }); after = Ti.Codec.decodeString({ charset: Ti.Codec.CHARSET_ISO_LATIN_1, source: buffer, position: 15600, length: before.length }); Ti.API.info('after = ' + after); Ti.API.info('buffer bytes = ' + bytes); Console log without curly quotes: --------------------------------- [INFO] : before = This has no quotes [INFO] : after = This has no quotes [INFO] : buffer bytes = 84,104,105,115,32,104,97,115,32,110,111,32,113,117,111,116,101,115,0 Version of example with before string containing curly quotes. Does not write characters into the buffer. --------------------------------------------------------------------------------------------------------- // When a string contains smart quotes (single or double), then encodeString // does not work. The string is not written into the buffer and only 0 bytes // are in the buffer. var buffer = Ti.createBuffer({ length: 46800 }); var before = 'This “has” quotes'; var after; var bytes = new Array(before.length); Ti.API.info('before = ' + before); Ti.Codec.encodeString({ charset: Ti.Codec.CHARSET_ISO_LATIN_1, source: before, dest: buffer, destPosition: 15600 }); for (var b = 0; b < before.length; b ++) bytes[b] = Ti.Codec.decodeNumber({ source: buffer, position: 15600 + b, type: Ti.Codec.TYPE_BYTE }); after = Ti.Codec.decodeString({ charset: Ti.Codec.CHARSET_ISO_LATIN_1, source: buffer, position: 15600, length: before.length }); Ti.API.info('after = ' + after); Ti.API.info('buffer bytes = ' + bytes); Console log with curly quotes: ------------------------------ [INFO] : before = This “has” quotes [INFO] : after = [INFO] : buffer bytes = 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0